import React, { Fragment } from 'react'
import { FormInstance, FormLayout } from 'antd/lib/form/Form'
import { SchemaTypeItem, SchemaItem } from '../index'
import WidgetRender from './WidgetRender'
interface Props {
  schemas: SchemaItem[]
  formInstance:FormInstance
  layout: FormLayout
  row?: SchemaTypeItem['row']
  onFinish: (values: Object) => void
}

function index({ schemas, ...reset }: Props) {
  return (
    <Fragment>
      {schemas.map((schema: SchemaItem) => {
        return (
          <Fragment key={schema.key}>
            <WidgetRender schema={schema} {...reset}></WidgetRender>
          </Fragment>
        )
      })}
    </Fragment>
  )
}
export default index
